import sys 
import os 
# 加载项目目录
sys.path.append(os.path.realpath('')) 
from  app.dbhandle import sqlscript
'''
数据格式json 
'''
from  app.dbhandle import dbcon
sqldb = dbcon.SqlLite

def  insert_blog_url(name,url,db=sqldb):
    sql = sqlscript.Sql_insert_into_blog_set
    try :
        db.exe_sql(sql,(name,url))
        return 0
    except Exception as ex:
        print(ex)
        print("插入失败")
        return -1
        
     
if __name__ == "__main__":

    # import dbcon
    # sqldb = dbcon.SqlLite
    c = insert_blog_url('小红',"www.baidu.com")
    print(c)